home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_CATOPEN.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
2KB
|
66 lines
PROCEDURE _CatOpen
PARAMETER pl_ok
*---------------------------------------------------------------------
* NAME
* _CatOpen - open the current catalog file
*
* DESCRIPTION
* _CatOpen opens the current catalog with an ALIAS of FXCatalog.
* If _CatOpen cannot open the catalog, it will return a .F.
* Otherwise it will return .T.
*
* SYNOPSIS
* DO _CatOpen WITH <pl_ok>
*
* PARAMETERS
* pl_ok = return .T. if opened, .F. if not
*
* EXAMPLE
* lc_cat = SET( "CATALOG" ) && Save the catalog state
* SET CATALOG OFF && Force the catalog off
* isok = .F. && Assume no catalog available
* DO _CatOpen WITH isok && Try and open the catalog
* SELECT FXCatalog && Select the FXCatalog work area
* ... && Catalog manipulation code here
* DO _CatClose && Close the catalog
* IF lc_cat = "ON" && If the catalog was on before
* SET CATALOG OFF && Turn the catalog back on
* ENDIF
*
* LIMITATIONS
* CATALOG must be OFF, otherwise the catalog name will end up
* in the catalog file.
*
* DEPENDENCIES
* Calls: _CatCurr - Get the current catalog
*
* VARIABLES
* lc_catname = Name of the catalog file to open. Value set by
* _CatCurr.
*
*---------------------------------------------------------------------
PRIVATE lc_catname
pl_ok = .F. && Assume it does not work
lc_catname = "" && Assume it does not work
DO _CatCurr WITH lc_catname && Get the current catalog name
IF .NOT. ISBLANK( lc_catname ) && Did it find a catalog?
ON ERROR DO _F_Error
*-- Open the current catalog file
USE ( lc_catname ) AGAIN ALIAS FXCatalog IN SELECT() NOLOG
IF TYPE( "FXL_Error" ) <> "L"
pl_ok = .T. && Set the result to success
ELSE
RELEASE FXL_Error
ENDIF
ENDIF
RETURN
*-- EOP: _CatOpen WITH pl_ok